<template>
    <div class="container">
      <div class="descrips">
        <div class="score">
          {{i}}.<b>（判断题 {{detail.totalScore.toFixed(1)}}分）</b>
        </div>
        <template v-for="(item, index) in detail.descrips">
          <p v-if="item.type == 'fulltext'" :key="index" class="title">{{item.content}}</p>
        </template>
      </div>
      <div class="option">
        <div v-for="item in detail.options" class="option-item">
          <p>{{item.code}}<b>.</b> {{item.content}}</p>
        </div>
      </div>
      <div class="answer">
        <div class="answer-inline">
          <div class="student">学生答案：{{detail.studentAnswer.yesOrNo ? '对' : '错'}}</div>
          <div class="right">正确答案：{{detail.answer.yesOrNo ? '对' : '错'}}</div>
          <div class="correct">批改结果：<span>{{detail.isRight ? '正确' : '错误'}}</span></div>
          <div class="result">得分：{{detail.score.toFixed(1)}}分</div>
        </div>
      </div>
    </div>
  </template>
  
  <script>
  export default {
    name: "Basic",
    props: {
      i: {
        type: Number,
        default: 1
      },
      initVal: {
        type: Object,
        default: () => ({})
      }
    },
    data() {
      return {
        detail: {
          totalScore: 5.0,
          descrips: [{
            type: 'fulltext',
            content: '本题是否正确？'
          }],
          options: [{
            code: 'A',
            content: '对'
          }, {
            code: 'B',
            content: '错'
          }],
          answer: { yesOrNo: 1 },
          studentAnswer: { yesOrNo: 0 },
          isRight: 0,
          score: 5.0,
        },
      }
    },
  }
  </script>
  
  <style lang="scss" scoped>
  @import './index.scss';
  </style>
  